/*
 * Copyright (c) 2017. Visionet and/or its affiliates. All right reserved.
 * VISIONET PROPRIETARY/CONFIDENTIAL.
 */
package com.visionet.security.repository;

import java.util.List;

import com.visionet.jumper.core.domain.bean.Page;
import com.visionet.jumper.core.repository.BaseRepository;
import com.visionet.security.domain.entity.Resource;
import com.visionet.security.domain.dto.UrlizedResource;
import com.visionet.security.base.enums.ResourceType;
import org.springframework.stereotype.Repository;

/**
 *
 * @author suxiaojing
 * @date 
 * @since 0.0.1
 */
@Repository
public interface SecurityResourceRepository extends BaseRepository<Resource> {

	Page getMenuForPage(Page page);

	/**
	 * @param menu
	 * @return
	 */
	List<Resource> findByTypeAndIsDeleted(ResourceType menu, Boolean isDeleted);

	/**
	 * @param menu
	 * @param level
	 * @return
	 */
	List<Resource> findByTypeAndLevel(ResourceType menu, Integer level);

	/**
	 * @param typeList
	 * @return
	 */
	List<Resource> getUrlizedResource(List<ResourceType> typeList);

	/**
	 * @param userId
	 * @return
	 */
	List<UrlizedResource> getUserMenu(String userId);

}
